#include <bits/stdc++.h>
using namespace std;
int r[100001],cnt[100001],s[100001],ans;
int main()
{
	freopen("duel.in","r",stdin);
	freopen("duel.out","w",stdout);
	int n;
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		scanf("%d",&r[i]);
		cnt[r[i]]++;
	}
	for(int i=1;i<=100000;i++)
	{
		if(cnt[i]>=s[i-1])
			s[i-1]=0;
		else
			s[i-1]-=cnt[i];
		s[i]=s[i-1]+cnt[i];
	}
	cout<<s[100000];
	return 0;
}
